<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">

    <title>用户编辑</title>

    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/signin.css" rel="stylesheet">
</head>

<body>
    <div>
        <a href="/">首页</a>
        <a href="javascript:void(0)" onclick="signout_fn()" >退出</a>
        <h1>用户编辑</h1>
        <p><a href="/user/authority/edit/page">权限编辑</a></p>

    </div>
    <script type="text/javascript" src="/js/jquery-1.12.4.js"></script>
    <script type="text/javascript">
        $(function () {
            $.ajax({
                url: '/user/edit',
                type: 'POST',
                success: function (data, status) {
                    if (data.code == 1000){
                        // TODO 渲染数据
                    } else {
                        alert(data.message);
                    }
                }
            });
        });
        function signout_fn() {
            $.ajax({
                url: '/authentication/signout',
                type: 'GET',
                success: function (data) {
                    if (data.code == 1000) {
                        alert("注销成功");
                        window.location.href = '/';
                    }
                }
            });
        }
    </script>

</body>
</html>
